package com.hwh.trafficdemo.dao;

import com.hwh.trafficdemo.entity.Stops;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
@Mapper
public interface IStopDao {

    @Insert("INSERT into stop(route_id,stop_id,stop_name) values (#{routeId},#{stopId},#{stopName})")
    public void saveStop(Stops stop);

    @Select("SELECT stop_id FROM stop WHERE stop_name like CONCAT(#{stopName},'%')")
    public List<Long> findStopIdByName(String stopName);
}
